package com.travel.cms.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;


import com.travel.cms.Content;
import com.travel.cms.service.IContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author muzi
 * @since 2021-04-14
 */
@RestController
@RequestMapping("/cms/content")
public class ContentController {

    //注入service
    @Autowired
    private IContentService iContentService;

    //查询内容
    @RequestMapping("findContentByCid")
    public List<Content> findContentByCid(String cid){

        QueryWrapper<Content> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("category_id",cid);
        return iContentService.list(queryWrapper);

    }
}
